This snippet allows you to check whether a number is decimal or not.

//This snippet checks if a number is decimal or not
<?php
//Function that checks if a number is decimal
function validate($v) {
	return(floor($v) != $v);//if the number is not a whole number then its a decimal.
}
//Example
if (validate(0.52)==true) { //if the number is a decimal then print success message
		echo "Number is a decimal";
	}
	else { // else print failure message.
		echo "Number is not a decimal";
	}
?>